package com.tedu.weibo.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

@Data
public class UserLoginDTO {
//    @NotNull(message = "用户名不能为空")//message表示验证不通过后抛出异常中的异常消息
//    @NotEmpty(message = "用户名不能为空")
//    @NotBlank(message = "用户名不能为空")  //包含了前两个
//    @Size(min = 6, max = 20,message = "用户名必须在6-20个字符之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,7}|[a-zA-Z0-9]{1,14}$",message = "中文要求1-7个字符，英文要求1-14字符")
    @ApiModelProperty(value = "用户名",required=true,example = "张三")
    private String username;
    @ApiModelProperty(value = "密码",required = true,example = "123456")
    private String password;
}
